/* 人事-基础设置-实习设置api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
const baseURL = env.VITE_APP_BASE_URL;
// const baseURL = 'http://192.168.31.129:39001';
// const baseURL = 'http://192.168.31.129:39003';
// const baseURL2 = 'http://192.168.31.129:39002';
// const baseURL2 = 'http://192.168.31.129:39003';
const baseURL2 = env.VITE_APP_BASE_URL;

// 获取实习评价列表
export function GetInternshipEvaluationList(params?: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template',
    method: 'get',
    baseURL,
    params
  });
}

// 检查实习指标
export function CheckInternshipEvaluationList(params: { name: string }) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/repeat/use',
    method: 'get',
    baseURL,
    params
  });
}

// 获取实习评价列表详情
export function GetInternshipEvaluationDetail(params: { id: number }) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/detail',
    method: 'get',
    baseURL,
    params
  });
}

// 新增实习评价列表
export function PostInternshipEvaluationList(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template',
    method: 'post',
    baseURL,
    data
  });
}

// 编辑实习评价列表
export function PutInternshipEvaluationList(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template',
    method: 'put',
    baseURL,
    data
  });
}

// 编辑实习评价模板控件是否显示
export function PutInternshipEvaluationTemplateShow(data: any) {
  return ajaxService({
    url: '/pl/practice/appraise/show',
    method: 'put',
    baseURL,
    data
  });
}

/**
 * 删除实习评价列表
 * type ： 1最外层列表 2内层实习指标表格 3内层自定义实习评价
 * */
export function DelInternshipEvaluationList(data: {
  ids: number[];
  type: 1 | 2 | 3;
}) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template',
    method: 'delete',
    baseURL,
    data
  });
}

// 删除实习评价详情里面的指标列表
export function DelInternshipEvaluationIndex(params: any) {
  return ajaxService({
    url: '/pl/practice/appraise/norms',
    method: 'delete',
    baseURL,
    params
  });
}

// 修改实习评价列表默认模板状态
export function PutInternshipEvaluationTemplateState(data: { id: number }) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/default',
    method: 'put',
    baseURL,
    data
  });
}

// 获取实习证明模板列表
export function GetInternshipCertificateTemplate(params: any) {
  return ajaxService({
    url: '/pl/practice/prove',
    method: 'get',
    baseURL,
    params
  });
}

// 新增实习证明模板列表
export function PostInternshipCertificateTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/prove',
    method: 'post',
    baseURL,
    data
  });
}

// 修改实习证明模板列表
export function PutInternshipCertificateTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/prove',
    method: 'put',
    baseURL,
    data
  });
}

// 修改实习证明模板列表默认模板状态
export function PutInternshipCertificateTemplateState(params: any) {
  return ajaxService({
    url: '/pl/practice/prove/default',
    method: 'put',
    baseURL,
    params
  });
}

// 删除实习证明模板列表
export function DelInternshipCertificateTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/prove',
    method: 'delete',
    baseURL,
    data
  });
}

// 获取实习开具证明模板列表
export function GetInternshipProofTemplate(params: any) {
  return ajaxService({
    url: '/pl/practice/self',
    method: 'get',
    baseURL,
    params
  });
}

// 新增实习开具证明模板列表
export function PostInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/self',
    method: 'post',
    baseURL,
    data
  });
}

// 修改实习开具证明模板列表
export function PutInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/self',
    method: 'put',
    baseURL,
    data
  });
}

// 修改实习开具证明模板列表默认模板状态
export function PutInternshipProofTemplateState(params: any) {
  return ajaxService({
    url: '/pl/practice/self/default',
    method: 'put',
    baseURL,
    params
  });
}

// 删除实习开具证明模板列表
export function DelInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/pl/practice/self',
    method: 'delete',
    baseURL,
    data
  });
}

// 新增实习指标
export function PostInternshipIndex(data: any) {
  return ajaxService(
    {
      url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library',
      method: 'post',
      baseURL,
      data
    },
    {
      message: '新增成功',
      mode: 'success'
    }
  );
}

// 修改实习指标
export function PutInternshipIndex(data: any) {
  return ajaxService(
    {
      url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library',
      method: 'put',
      baseURL,
      data
    },
    {
      message: '修改成功',
      mode: 'success'
    }
  );
}

// 获取实习指标列表
export function GetInternshipIndex(params: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library',
    method: 'get',
    baseURL,
    params
  });
}

// 检查实习指标查重
export function CheckInternshipIndex(params: { name: string }) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/repeat',
    method: 'get',
    baseURL,
    params
  });
}

// 删除实习指标
export function DelInternshipIndex(data: { ids: number[] }) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library',
    method: 'delete',
    baseURL,
    data
  });
}
